import { Module } from '@nestjs/common';
import { PointsGoodsService } from './points-goods.service';
import { PointsGoodsController } from './points-goods.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PointsGoodsEntity } from './points-goods.entity';
import { UploadModule } from '~/modules/tools/upload/upload.module';
import { PointsGoodsExchangeModule } from './points-goods-exchange/points-goods-exchange.module';
import { RouterModule } from '@nestjs/core';

const modules = [PointsGoodsExchangeModule];

@Module({
  imports: [
    TypeOrmModule.forFeature([PointsGoodsEntity]),
    RouterModule.register([
      {
        path: 'cms/points/goods',
        module: PointsGoodsModule,
        children: [...modules],
      },
    ]),
    UploadModule,
    ...modules,
  ],
  controllers: [PointsGoodsController],
  providers: [PointsGoodsService],
  exports: [PointsGoodsService, TypeOrmModule, ...modules],
})
export class PointsGoodsModule {}
